<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title> each() </title>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
</head>

<body>
<ul>
    <li data-test="1">포도</li>
    <li data-test="2">바나나</li>
    <li data-test="3">사과</li>
</ul>  


<!------------------------ jQuery 코드 ----------------------->
<script>
$('li').each(function(index, element) {
	console.log ("index =" + index );
	console.log ("element =" + element );
	console.log ("this =" + this );
	console.log ("text =" + $(this).text() );
	console.log ("data-test =" + $(this).attr("data-test") );
	console.log ("=========================================");
});
</script>  

</body>
</html>
